package com.cn.service;

import com.cn.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 业务层
 */
@Service
public class UserService {
    @Autowired
    private UserRepository userRepository;

    public String getUserNameById(int id){
        User user = userRepository.findUserById(id);
        userRepository.findUserById(id);
        return user != null? user.getName() : null;
    }
}
